<template>
	<view>
		<my-animation :share="share" :height="height" @display="display">
			<template v-slot:spOne>
				<view class="gender-con">
					<view class="title">
						<text>选择性别:</text>
					</view>

					<radio-group @change="sexChange">
						<view class="sex">
							<view class="sexRadio">
								<radio color="#2DCF8C" :value="2 + ''" />
								<text>女</text>
							</view>
							<view class="sexRadio">
								<radio color="#2DCF8C" :value="1 + ''" />
								<text>男</text>
							</view>
						</view>
					</radio-group>

					<view class="bottom">
						<view class="button" @click="updateGender">
							<text>更改</text>
						</view>
					</view>
				</view>
			</template>
		</my-animation>
	</view>
</template>

<script>
	import myAnimation from '@/components/common/my-animation/my-animation.vue'

	export default {
		props: {
			share: {
				type: Boolean,
				default: false
			}
		},
		components: {
			myAnimation
		},
		data() {
			return {
				height: '500',
				gender: 0
			}
		},
		methods: {
			display(share) {
				this.$emit('display', share)
			},
			sexChange(evt) { //性别选择
				this.gender = parseInt(evt.detail.value)
			},
			updateGender() {
				this.$emit('updateGender', this.gender)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.gender-con {
		.title {
			text-align: center;
			margin: 50rpx 0;

		}

		.sex {
			display: flex;
			width: 100%;
			margin-left: 20%;

			.sexRadio {
				text-align: center;
				width: 30%;

			}
		}

		.bottom {
			width: 100%;
			margin-top: 100rpx;

			.button {
				width: 30%;
				height: 60rpx;
				line-height: 60rpx;
				margin-left: 35%;
				background: #2DCF8C;
				border-radius: 30rpx;
				text-align: center;

				text {

					color: #fff;
					font-size: 32rpx;
				}
			}
		}
	}
</style>
